package com.doit.demo01;

import java.io.*;

public class test01 {
    public static void main(String[] args) throws IOException {
        Reader r = new FileReader("D:\\work\\abc\\IO练习题\\第一题.txt");
        StringBuilder sb = new StringBuilder();

        int len = 0;
        char[] chars = new char[1024];
        while((len=r.read(chars))!=-1){
            sb.append(chars,0,len);
            System.out.println(new String(chars,0,len));
        }

        Writer w = new FileWriter("D:\\work\\abc\\IO练习题\\第一题.txt");
        w.write(sb.reverse().toString().toCharArray());
        w.flush();

        IO_Close.close(r,w);

    }
}
